<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>博客注册</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        body {
            background-color: #f5f5f5;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background-image: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
        }
        
        .register-container {
            width: 100%;
            max-width: 400px;
            padding: 2rem;
            background: white;
            border-radius: 10px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s ease;
        }
        
        .register-container:hover {
            transform: translateY(-5px);
        }
        
        .logo {
            text-align: center;
            margin-bottom: 2rem;
        }
        
        .logo h1 {
            color: #333;
            font-size: 2rem;
            font-weight: 700;
        }
        
        .logo p {
            color: #666;
            margin-top: 0.5rem;
        }
        
        .form-group {
            margin-bottom: 1.5rem;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            color: #555;
            font-weight: 500;
        }
        
        .form-group input {
            width: 100%;
            padding: 0.8rem 1rem;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 1rem;
            transition: border 0.3s ease;
        }
        
        .form-group input:focus {
            border-color: #4a90e2;
            outline: none;
            box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
        }
        
        .terms {
            display: flex;
            align-items: center;
            margin-bottom: 1.5rem;
        }
        
        .terms input {
            margin-right: 0.5rem;
        }
        
        .terms label {
            color: #555;
            font-size: 0.9rem;
        }
        
        .terms a {
            color: #4a90e2;
            text-decoration: none;
        }
        
        .register-button {
            width: 100%;
            padding: 0.8rem;
            background-color: #4a90e2;
            color: white;
            border: none;
            border-radius: 5px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.3s ease;
            margin-bottom: 1.5rem;
        }
        
        .register-button:hover {
            background-color: #3a7bc8;
        }
        
        .login-link {
            text-align: center;
            color: #666;
        }
        
        .login-link a {
            color: #4a90e2;
            text-decoration: none;
            font-weight: 500;
        }
        
        .error {
            color: red;
            text-align: center;
            margin-bottom: 1rem;
            background-color: rgba(255, 0, 0, 0.1);
            padding: 0.5rem;
            border-radius: 5px;
            font-size: 0.9rem;
        }
    </style>
</head>
<body>
    <div class="register-container">
        <div class="logo">
            <h1>博客空间</h1>
            <p>加入我们，开始创作</p>
        </div>
        
        <% if (request.getAttribute("error") != null) { %>
            <p class="error"><%= request.getAttribute("error") %></p>
        <% } %>
        
        <form method="post" action="${pageContext.request.contextPath}/auth/register">
            <div class="form-group">
                <label for="username">用户名</label>
                <input type="text" id="username" name="username" placeholder="设置您的用户名" required>
            </div>
            
            <div class="form-group">
                <label for="password">密码</label>
                <input type="password" id="password" name="password" placeholder="设置登录密码" required>
            </div>
            
            <div class="terms">
                <input type="checkbox" id="agree-terms" required>
                <label for="agree-terms">我已阅读并同意<a href="#">服务条款</a></label>
            </div>
            
            <button type="submit" class="register-button">注册</button>
        </form>
        
        <div class="login-link">
            <p>已有账号? <a href="${pageContext.request.contextPath}/auth/login">立即登录</a></p>
        </div>
    </div>
</body>
</html> 